/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Core.impl;

import EA_Model.IEC61970.Core.CorePackage;
import EA_Model.IEC61970.Core.CurveData;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Curve Data</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Core.impl.CurveDataImpl#getXvalue <em>Xvalue</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.CurveDataImpl#getY1value <em>Y1value</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.CurveDataImpl#getY2value <em>Y2value</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Core.impl.CurveDataImpl#getY3value <em>Y3value</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CurveDataImpl extends EObjectImpl implements CurveData {
	/**
	 * The cached value of the '{@link #getXvalue() <em>Xvalue</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getXvalue()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float xvalue;

	/**
	 * The cached value of the '{@link #getY1value() <em>Y1value</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getY1value()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float y1value;

	/**
	 * The cached value of the '{@link #getY2value() <em>Y2value</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getY2value()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float y2value;

	/**
	 * The cached value of the '{@link #getY3value() <em>Y3value</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getY3value()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float y3value;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CurveDataImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CorePackage.Literals.CURVE_DATA;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getXvalue() {
		if (xvalue != null && xvalue.eIsProxy()) {
			InternalEObject oldXvalue = (InternalEObject)xvalue;
			xvalue = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldXvalue);
			if (xvalue != oldXvalue) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.CURVE_DATA__XVALUE, oldXvalue, xvalue));
			}
		}
		return xvalue;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetXvalue() {
		return xvalue;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setXvalue(EA_Model.IEC61970.Domain.Float newXvalue) {
		EA_Model.IEC61970.Domain.Float oldXvalue = xvalue;
		xvalue = newXvalue;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.CURVE_DATA__XVALUE, oldXvalue, xvalue));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getY1value() {
		if (y1value != null && y1value.eIsProxy()) {
			InternalEObject oldY1value = (InternalEObject)y1value;
			y1value = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldY1value);
			if (y1value != oldY1value) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.CURVE_DATA__Y1VALUE, oldY1value, y1value));
			}
		}
		return y1value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetY1value() {
		return y1value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setY1value(EA_Model.IEC61970.Domain.Float newY1value) {
		EA_Model.IEC61970.Domain.Float oldY1value = y1value;
		y1value = newY1value;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.CURVE_DATA__Y1VALUE, oldY1value, y1value));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getY2value() {
		if (y2value != null && y2value.eIsProxy()) {
			InternalEObject oldY2value = (InternalEObject)y2value;
			y2value = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldY2value);
			if (y2value != oldY2value) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.CURVE_DATA__Y2VALUE, oldY2value, y2value));
			}
		}
		return y2value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetY2value() {
		return y2value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setY2value(EA_Model.IEC61970.Domain.Float newY2value) {
		EA_Model.IEC61970.Domain.Float oldY2value = y2value;
		y2value = newY2value;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.CURVE_DATA__Y2VALUE, oldY2value, y2value));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getY3value() {
		if (y3value != null && y3value.eIsProxy()) {
			InternalEObject oldY3value = (InternalEObject)y3value;
			y3value = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldY3value);
			if (y3value != oldY3value) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.CURVE_DATA__Y3VALUE, oldY3value, y3value));
			}
		}
		return y3value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetY3value() {
		return y3value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setY3value(EA_Model.IEC61970.Domain.Float newY3value) {
		EA_Model.IEC61970.Domain.Float oldY3value = y3value;
		y3value = newY3value;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.CURVE_DATA__Y3VALUE, oldY3value, y3value));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CorePackage.CURVE_DATA__XVALUE:
				if (resolve) return getXvalue();
				return basicGetXvalue();
			case CorePackage.CURVE_DATA__Y1VALUE:
				if (resolve) return getY1value();
				return basicGetY1value();
			case CorePackage.CURVE_DATA__Y2VALUE:
				if (resolve) return getY2value();
				return basicGetY2value();
			case CorePackage.CURVE_DATA__Y3VALUE:
				if (resolve) return getY3value();
				return basicGetY3value();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CorePackage.CURVE_DATA__XVALUE:
				setXvalue((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case CorePackage.CURVE_DATA__Y1VALUE:
				setY1value((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case CorePackage.CURVE_DATA__Y2VALUE:
				setY2value((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case CorePackage.CURVE_DATA__Y3VALUE:
				setY3value((EA_Model.IEC61970.Domain.Float)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CorePackage.CURVE_DATA__XVALUE:
				setXvalue((EA_Model.IEC61970.Domain.Float)null);
				return;
			case CorePackage.CURVE_DATA__Y1VALUE:
				setY1value((EA_Model.IEC61970.Domain.Float)null);
				return;
			case CorePackage.CURVE_DATA__Y2VALUE:
				setY2value((EA_Model.IEC61970.Domain.Float)null);
				return;
			case CorePackage.CURVE_DATA__Y3VALUE:
				setY3value((EA_Model.IEC61970.Domain.Float)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CorePackage.CURVE_DATA__XVALUE:
				return xvalue != null;
			case CorePackage.CURVE_DATA__Y1VALUE:
				return y1value != null;
			case CorePackage.CURVE_DATA__Y2VALUE:
				return y2value != null;
			case CorePackage.CURVE_DATA__Y3VALUE:
				return y3value != null;
		}
		return super.eIsSet(featureID);
	}

} //CurveDataImpl
